public class ThreadDemo21 {
    public static void main(String[] args) {
        synchronized (ThreadDemo21.class){
            System.out.println("线程执行进入了方法");
            synchronized (ThreadDemo21.class){
                System.out.println("线程执行又进入了方法");
                synchronized (ThreadDemo21.class){
                    System.out.println("线程执行又又进入了方法");
                }
            }
        }
    }
}
